<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>教师端--修改实验</title>
<script src="${basePath}js/jquery.js"></script>
<script src="${basePath}js/pintuer.js"></script>
<script type="text/javascript"
	src="http://apps.bdimg.com/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="${basePath}js/jquery.min.js"></script>
<script type="text/javascript" src="${basePath}js/bootstrap-select.js"></script>
<link rel="stylesheet" type="text/css"
	href="${basePath}css/bootstrap-select.css">
<link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css"
	rel="stylesheet">
<!-- <link href="css/bootstrap.min.css" rel="stylesheet">-->
<script src="${basePath}js/bootstrap.min.js"></script>
<script type="text/javascript">
	$(window).on('load', function() {
		$('.selectpicker').selectpicker({
			'selectedText' : 'cat'
		});
	});
</script>
<link rel="stylesheet" href="${basePath}css/pintuer.css">
<link rel="stylesheet" href="${basePath}css/admin.css">
</head>
<script type="text/javascript">
	$(function() {
		$("#revise").click(function() {
			javascript: history.go(-1);
		})
	})
</script>
<script type="text/javascript">
	(
					function($) {
						// tipWrap: 提示消息的容器
						// maxNumber: 最大输入字符
						$.fn.artTxtCount = function(tipWrap, maxNumber) {
							var countClass = 'js_txtCount',
							// 定义内部容器的CSS类名
							fullClass = 'js_txtFull',
							// 定义超出字符的CSS类名
							disabledClass = 'disabled'; // 定义不可用提交按钮CSS类名
							// 统计字数
							var count = function() {
								var btn = $(this).closest('form').find(
										':submit'), val = $(this).val().length,
								// 是否禁用提交按钮
								disabled = {
									on : function() {
										btn.removeAttr('disabled').removeClass(
												disabledClass);
									},
									off : function() {
										btn.attr('disabled', 'disabled')
												.addClass(disabledClass);
									}
								};
								if (val == 0)
									disabled.off();
								if (val <= maxNumber) {
									if (val > 0)
										disabled.on();
									tipWrap
											.html('<span class="' + countClass + '">\u8FD8\u80FD\u8F93\u5165 <strong>'
													+ (maxNumber - val)
													+ '</strong> \u4E2A\u5B57</span>');
								} else {
									disabled.off();
									tipWrap
											.html('<span class="' + countClass + ' ' + fullClass + '">\u5DF2\u7ECF\u8D85\u51FA <strong>'
													+ (val - maxNumber)
													+ '</strong> \u4E2A\u5B57</span>');
								}
								;
							};
							$(this).bind('keyup change', count);
							return this;
						};
					})(jQuery);
	// demo
	jQuery(function() {
		// 批量
		$('.form-group').each(
				function() {
					$(this).find('#expObjective').artTxtCount(
							$(this).find('.tips'), 1000);
					$(this).find('#expEquip').artTxtCount(
							$(this).find('.tips'), 1000);
					$(this).find('#expContent').artTxtCount(
							$(this).find('.tips'), 1000);
					$(this).find('#expRequire').artTxtCount(
							$(this).find('.tips'), 1000);
				});

	});
</script>
<style type="text/css">
.file1 {
	position: absolute;
	top: 0;
	left: 0px;
	height: 40px;
	filter: alpha(opacity : 0);
	opacity: 0;
	width: 100%
}
</style>
<body>
	<div class="panel admin-panel">
		<div class="panel-head">
			<strong><span class="icon-pencil-square-o"></span>修改实验</strong> <span
				style="margin-left: 85%"><a id="revise" href="#">返回</a></span>
		</div>
		<div class="body-content">
			<form method="post" class="form-x"
				action="updateExpInfo.do"
				enctype="multipart/form-data">
				<input type="hidden" name="expIndex"
					value="${requestScope.expB.expIndex}">
				<div class="form-group">
					<div class="label">
						<label>实验名称：</label>
					</div>
					<div class="field">
						<input id="expName" type="text" class="input" name="expName"
							value="${requestScope.expB.expName}" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>课程名称：</label>
					</div>
					<div class="field">
						<input id="expClass" type="text" class="input" name="expClass"
							value="${requestScope.expB.expClass}" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>课程代码：</label>
					</div>
					<div class="field">
						<input id="expId" type="text" class="input" name="expId"
							value="${requestScope.expB.expId}" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>实验班级：</label>
					</div>
					<div class="field">
						<label for="id_select"></label> <select id="stuClass"
							name="stuClass" class="selectpicker bla bla bli" multiple
							data-live-search="true">
							<option id="10" value="10">电信1班</option>
							<option id="11" value="11">电信2班</option>
							<option id="12" value="12">电科1班</option>
							<option id="13" value="13">电科2班</option>
							<option id="14" value="14">电科3班</option>
							<option id="15" value="15">信息1班</option>
							<option id="16" value="16">信息2班</option>
							<option id="17" value="17">光电1班</option>
							<option id="18" value="18">光电2班</option>
							<option id="19" value="19">集成1班</option>
							<option id="20" value="20">集成2班</option>
						</select>

						<div class="tips"></div>
					</div>
				</div>
				<script type="text/javascript">
					function display(optionID) {
						var all_options = document.getElementById("stuClass").options;
						for (i = 0; i < all_options.length; i++) {
							if (all_options[i].id == optionID) // 根据option标签的ID来进行判断  测试的代码这里是两个等号
							{
								all_options[i].selected = true;
							}
						}
					};
				<%String name = (String) request.getAttribute("stucla");%>
					
				<%String[] arr = name.split(",");
			for (int i = 0; i < arr.length; i++) {%>
					display(
				<%=arr[i]%>
					);
				<%}%>
					
				</script>
				<div class="form-group">
					<div class="label">
						<label>实验教师：</label>
					</div>
					<div class="field">
						<input id="teaName" type="text" class="input" name="teaName"
							value="${requestScope.expB.teaName}" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>实验地点：</label>
					</div>
					<div class="field">
						<input id="expAdd" type="text" class="input" name="expAdd"
							value="${requestScope.expB.expAdd}" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>开始时间：</label>
					</div>
					<div class="field">
						<input id="expBtime" type="text" class="input" name="expBtime"
							value="${requestScope.expB.expBtime}" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>结束时间：</label>
					</div>
					<div class="field">
						<input id="expEtime" type="text" class="input" name="expEtime"
							value="${requestScope.expB.expEtime}" />
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>实验目的：</label>
					</div>
					<div class="field">
						<textarea id="expObjective" type="text" class="input"
							name="expObjective" style="height: 120px;">${requestScope.expB.expObjective}</textarea>
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>实验器材：</label>
					</div>
					<div class="field">
						<textarea id="expEquip" type="text" class="input" name="expEquip"
							style="height: 120px;">${requestScope.expB.expEquip}</textarea>
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>实验内容：</label>
					</div>
					<div class="field">
						<textarea id="expContent" type="text" class="input"
							name="expContent" style="height: 120px;">${requestScope.expB.expContent}</textarea>
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>实验要求：</label>
					</div>
					<div class="field">
						<textarea id="expRequire" type="text" class="input"
							name="expRequire" style="height: 120px;">${requestScope.expB.expRequire}</textarea>
						<div class="tips"></div>
					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>电子讲义：</label>
					</div>
					<div class="field">

						<input type="text" name="expWord" class="input" id="expWord"
							value="${requestScope.expB.expWord}"><input type="file"
							name="file" class="file1" id="file" size="28" value=""
							onchange="document.getElementById('expWord').value=this.value" />
					</div>
				</div>
				<div class="form-group" id="submit">
					<div class="label">
						<label></label>
					</div>
					<div class="field">
						<button class="button bg-main icon-check-square-o" type="submit">
							确认修改</button>
					</div>
				</div>
			</form>
		</div>
	</div>

</body>
</html>